home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / zip2obj.zip / VGABIOS.ASM < prev    next >
Assembly Source File  |  1991-11-12  |  3KB  |  130 lines

  1. PAGE 59, 132
  2. LOCALS @@
  3.  
  4. Code       SEGMENT Byte Public
  5.            ASSUME  CS:Code
  6.            Public  GetVideoMode, GetDisplayPage
  7.            Public  GetColourBlock, SetColourBlock
  8.            Public  SetBlink, SetIntensity
  9.            Public  GetPalette, SetPalette
  10.            Public  GetColourPage, SetColourPage
  11.            Public  GetPageMode, SetPageMode
  12.  
  13. ;  Function GetVideoMode : Byte;
  14. ;  Function GetDisplayPage : Byte;
  15.  
  16. GetVideoMode PROC
  17.            CLC
  18.            JMP     Short @@1
  19.  
  20. GetDisplayPage:
  21.            STC
  22. @@1:       MOV     AH, 0Fh
  23.            INT     10h
  24.            JNC     @@2
  25.            MOV     AL, BH
  26. @@2:       RETF
  27. GetVideoMode ENDP
  28.  
  29. ;  Procedure SetBlink;
  30. ;  Procedure SetIntensity;
  31.  
  32. SetBlink   PROC
  33.            MOV     BL, 1
  34.            JMP     Short @@1
  35.  
  36. SetIntensity:
  37.            MOV     BL, 0
  38. @@1:       MOV     AX, 1003h
  39.            INT     10h
  40.            RETF
  41. SetBlink   ENDP
  42.  
  43. ;  Procedure GetPalette(Var palette : PaletteType);
  44. ;  Procedure SetPalette(palette : PaletteType);
  45.  
  46. GetPalette PROC
  47.            MOV     AX, 1009h
  48.            JMP     Short @@1
  49.  
  50. SetPalette:
  51.            MOV     AX, 1002h
  52. @@1:       PUSH    BP
  53.            MOV     BP, SP
  54.  
  55.            mov     dx, 3dah
  56.            cli
  57. @@2:       in      al, dx
  58.            test    al, 8
  59.            jnz     @@4
  60.            rcr     al, 1
  61.            jc      @@2
  62. @@3:       in      al, dx
  63.            rcr     al, 1
  64.            jnc     @@3
  65. @@4:       sti
  66.  
  67.            LES     DX, [BP+6]
  68.            INT     10h
  69.            POP     BP
  70.            RETF    4
  71. GetPalette ENDP
  72.  
  73. ;  Function GetColourPage : Byte;
  74. ;  Function GetPageMode : ColPageMode;
  75.  
  76. GetColourPage PROC
  77.            CLC
  78.            JMP     Short @@1
  79.  
  80. GetPageMode:
  81.            STC
  82. @@1:       MOV     AX, 101Ah
  83.            INT     10h
  84.            JNC     @@2
  85.            MOV     AL, BL
  86.            RETF
  87.  
  88. @@2:       MOV     AL, BH
  89.            RETF
  90. GetColourPage ENDP
  91.  
  92. ;  Procedure SetColourPage(page : Byte);
  93. ;  Procedure SetPageMode(pagemode : ColPageMode);
  94.  
  95. SetColourPage PROC
  96.            MOV     BL, 1
  97.            JMP     Short @@1
  98.  
  99. SetPageMode:
  100.            MOV     BL, 0
  101. @@1:       PUSH    BP
  102.            MOV     BP, SP
  103.            MOV     BH, [BP+6]
  104.            MOV     AX, 1013h
  105.            INT     10h
  106.            POP     BP
  107.            RETF    2
  108. SetColourPage ENDP
  109.  
  110. ;  Procedure GetColourBlock(Var RGBBlock : RGB64Type);
  111. ;  Procedure SetColourBlock(RGBBlock : RGB64Type);
  112.  
  113. GetColourBlock PROC
  114.            MOV     AX, 1017h
  115.            JMP     Short @@1
  116.  
  117. SetColourBlock:
  118.            MOV     AX, 1012h
  119. @@1:       PUSH    BP
  120.            MOV     BP, SP
  121.            LES     DX, [BP+6]
  122.            XOR     BX, BX
  123.            MOV     CX, 64
  124.            INT     10h
  125.            POP     BP
  126.            RETF    4
  127. GetColourBlock ENDP
  128.  
  129. Code       ENDS
  130.            END